package controller;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import model.MyEllipse;
import model.MyPosition;
import model.MyRectangle;
import model.TypeImage;
import view.EditShape;
import view.interfaces.IEditShape;
import view.interfaces.IProposition;

public class ControllerProposition implements ActionListener{
	
	private IProposition view;
	
    public ControllerProposition() {

        
    }

    public void setView(IProposition viewEntry) {
            
        this.view = viewEntry;
        
    }

	@Override
	public void actionPerformed(ActionEvent e) {
		
		String action = e.getActionCommand();

    	if(action.startsWith("EDITSHAPE")) {

    		EditShape windowForEditShape = new EditShape(view.getShapeToEditId());
    		
    		view.hideWindowEditShape();
    		
    	}else if (action.startsWith("REVERSE")) {
    		
    		ControllerHome.image.getShape(view.getShapeToEditId()).getType().reverse();
    		
    		view.hideWindowEditShape();
    	}
		
	}

}
